var app = angular.module("audit", []);
app.controller("login", [ "$scope", "$http", function($scope, $http) {
	$scope.info = {};
	$scope.errInfo = "";
	$scope.login = function() {
		$scope.errInfo = "";
		$http.post("./loginForm", $scope.info).success(function(data) {
			if (data.status == "ok") {
				location.href = "./index";
			} else {
				$scope.errInfo = data.msg;
			}
		}).error(function() {
			$scope.errInfo = "网络错误，请稍后再试";
		});
	};
} ]);